package com.uu.it.tracker.views;



import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.widget.Toast;

public class SpeedGraphView extends Activity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState); 

			Bundle bundle = getIntent().getExtras();
			if(bundle != null){
				int[] values = bundle.getIntArray("speed");
				int maxSpeed = bundle.getInt("maxSpeed");
				if(values != null)
				{
					String[] verlabels = new String[] {""+maxSpeed, ""+maxSpeed*2/3, ""+maxSpeed/3, "0" };
					String[] horlabels = new String[] {"" };
					DrawGraph gv = new DrawGraph(this, values, "Speed/time",horlabels, verlabels, DrawGraph.LINE);
					setContentView(gv);
				}
					
			}
	}
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_BACK){
			finish();
		}
		return super.onKeyDown(keyCode, event);
	}
}